<?php

namespace app\common\model;

/**=========================================
 * Copyright © 2023-2024, WICMS.CN. All Rights Reserved
 * Project Name: WiCMS
 * Description: 角色授权模型
 * Author: jason
 * Email: 52527998@QQ.COM
 * Date: 2024/11/9
 * Time: 22:38
 * File: app\common\Model\AdminRoleAccessModel.php
 * =========================================
 */

use think\model\Pivot;

class AdminRoleAccessModel extends Pivot
{

    protected $pk                 = 'id';
    protected $name               = 'AdminRoleAccess';

    // 删除某用户所有角色
    public static function deleteUserRoles(int $user_id): bool
    {
        return self::where('user_id', $user_id)->delete();
    }
}